#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "UartWorker.h"
#include "QThread"
#include "QImage"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

signals:

protected:
    void paintEvent(QPaintEvent *event) override;
protected slots:
    void handleResults(quint8 *data, quint32 size);
    void InitUartThread();// 仅在构造函数里使用
    void QuitUartThread();// 仅在析构函数里使用
    void SetImgColor(quint8*data,quint32 size);
private:
    Ui::Widget *ui;
//    UartWorker *workerThread;
    QThread workerThread;
    QImage *m_img;
};
#endif // WIDGET_H
